/**
 * Wihidum - Efficient Broker Hierarchy for Publish Subscribe Middleware
 *
 * License      :   Apache License 2.0
 * Home Page    :   http://code.google.com/p/wihidum/
 * Mailing List :   wihidum@googlegroups.com
 */

package lk.mrt.cse.wihidum.storage;

import java.util.ArrayList;

public class Topology
{

    private static boolean readOnce=false;
    private static String myId;
    private static String myAddress = null;
    private static String myRole = null;

    private static NeighbourBroker primarySuperUnit = new NeighbourBroker();

    private static ArrayList<NeighbourBroker> superUnitsArray = new ArrayList<NeighbourBroker>();
    private static ArrayList<NeighbourBroker> peerUnitsArray = new ArrayList<NeighbourBroker>();
    private static ArrayList<NeighbourBroker> subUnitsArray = new ArrayList<NeighbourBroker>();

    public static boolean isReadOnce()
    {
            return readOnce;
    }

    public static void setReadOnce(boolean readOnce)
    {
            Topology.readOnce = readOnce;
    }

    public static void setPeerUnits(ArrayList<NeighbourBroker> peerUnits)
    {

        peerUnitsArray = peerUnits;
    }

    public static ArrayList<NeighbourBroker> getPeerUnits()
    {
        return peerUnitsArray;
    }

    public static NeighbourBroker getPrimarySuperUnit()
    {
        return primarySuperUnit;
    }

    public static void setPrimarySuperUnit(NeighbourBroker priSuperUnit)
    {
        primarySuperUnit = priSuperUnit;
    }


    public static void setSuperUnits(ArrayList<NeighbourBroker> superUnits)
    {

        superUnitsArray = superUnits;
    }

    public static ArrayList<NeighbourBroker> getSuperUnits()
    {
      return superUnitsArray;
    }

    public static void setSubUnits(ArrayList<NeighbourBroker> subUnits)
    {
        subUnitsArray = subUnits;
    }

    public static ArrayList<NeighbourBroker> getSubUnits()
    {
        return subUnitsArray;
    }

    public static void setMyId(String myIdentifier)
    {
        myId = myIdentifier;
    }

    public static String getMyId()
    {
        return myId;
    }

    public static void setMyAddress(String address)
    {
        myAddress = address;
    }

    public static String getMyAddress()
    {
        return myAddress;
    }

    public static void setMyRole(String role)
    {
        myRole = role;
    }

    public static String getMyRole()
    {
        return myRole;
    }
}
